{
  open Printf
  open Outputparser
}

let id = ['a'-'z' 'A'-'Z' '{'] ['0'-'9' 'a'-'z' 'A'-'Z' '_' '-' '<' '>' '{' '}']*
let number = ['0'-'9']+

rule out_tokens = parse
  | [' ' '\t' '\n'] { out_tokens lexbuf } (* Skip whitespaces *)
  | "Relation"      { RELATION }
  | "/"             { SLASH }
  | ":"             { COLON }
  | ","             { COMMA }
  | "("             { LPAREN }
  | ")"             { RPAREN }
  | "#"             { ENDING }
  | id as str       { ID str }
  | number as num   { NUMBER (int_of_string num) }
  | _ as c          { printf "Unrecognized character: %c\n" c; CHAR c }
  | eof             { raise End_of_file }
